Skip to content

feat!: adjust linting to new outputs structure#1086

Merged
dlaehnemann merged 56 commits into
bioconda:masterfrom
dlaehnemann:fix/adjust-linting-to-new-outputs-structure
Jun 17, 2026
Merged

feat!: adjust linting to new outputs structure#1086
dlaehnemann merged 56 commits into
bioconda:masterfrom
dlaehnemann:fix/adjust-linting-to-new-outputs-structure

Conversation

@dlaehnemann

Copy link
Copy Markdown
Member

This pull request is basically git cherry-picking all the previous work in pull request #1073 , as that one's diff has gotten too confusing with a failed rebase --onto master attempt (I realized too late, that I am working on a fork, here...). In addition, this pull request is a bit more generic, trying to get a consistent linting and comprehensive linting tests for recipes with multiple outputs in general. The aim is to work towards supporting the new rattler-build driven recipe.yaml format that has been accepted as Conda Enhancement Proposals (CEPs) 13 and 14, by implementing the outputs: specification in the linting over here.

So, this is a fresh start after the overhaul of the linting test suite setup in #1085 has been merged. And to also link more previous work, this is the follow-up to pull request #1057, which did a first step towards better linting of multiple outputs.

Please note, that this will require updating all of the 7 recipes with multiple outputs so that they pass the new lints, also see here:
#1057 (comment)
The plan is to open a separate pull request for each of them on bioconda-recipes.

… lint, but probably there's a more elegant solution
…this still throws a linting error

```
FAILED test/test_lint.py::test_lint[should_be_noarch_python-meta-repodata0] - AssertionError: In test 'should_be_noarch_python' on 'meta_package':'skipping_recipe' emitted unexpectedly
assert 'skipping_recipe' in {'should_be_noarch_python'}
 +  where 'skipping_recipe' = str(<class 'bioconda_utils.lint.skipping_recipe'>)
 +    where <class 'bioconda_utils.lint.skipping_recipe'> = LintMessage(recipe=Recipe "meta_package", check=<class 'bioconda_utils.lint.skipping_recipe'>, severity=<Severity.INFO: 10>, title='skipping linting of this recipe as requested', body='\nAs specified via `extra: skip-recipes:`, this recipe is being\nskipped during linting. This is meant for the linter test\nsuite.', start_line=0, end_line=0, fname='/tmp/pytest-of-dlaehnemann/pytest-122/test_lint_should_be_noarch_pyt2/recipes/meta_package/meta.yaml', canfix=False).check
 ```

@epruesse epruesse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original PR already approved

@epruesse

epruesse commented Apr 9, 2026

Copy link
Copy Markdown
Member

@dlaehnemann The PRs will be squashed into one commit to the main branch anyway. If you think this should stay as multiple pieces, you'd have to do separate PRs or we'd have to somehow to the merge manually.

Also, I'm not sure about the classification as "fix". It might be a "feat!" (new feature with breaking change requiring major version bump). Thoughts?

@dlaehnemann

Copy link
Copy Markdown
Member Author

Basically, this has grown in scope since Johannes approved the original PR. and I did the overhaul of the linting test suite, which has been merged. So I cherry-picked all the relevant stuff here, so that we would have a clean diff in the pull request, mainly for the review of this pull request.
Without the cherry-picking, the resolution of the merge conflicts would have been harder and I also messed up the rebase, because I forgot that I was working on a fork...

But this is not yet done. I'm still working through all the cases with the new outputs: policy and trying to get the linting right (including dedicated test cases).

@dlaehnemann

Copy link
Copy Markdown
Member Author

OK, I think this is good to be reviewed and possibly merged.

This is another step towards proper linting of recipes with multiple outputs, also working towards supporting the new recipe.yaml format in that regard:
https://rattler-build.prefix.dev/v0.65.0/reference/multi_output/

However, I have restricted it to linting the stuff that the existing multi-output recipes in bioconda require. This means that the linting currently does not check all of the inheritance behavior of the v1 recipe format.
For example, the build number is only checked (and possibly fixed) on the top-level of the recipe, not per-output, as all the existing recipes just have a single build number and especially updating the automatic fixing code for the build numbers would be more involved.
Also, it might make sense to eventually adopt the lint (and build) infrastructure of conda-forge at some point, which is already implementing the new recipe format in a backwards compatible manner. So duplicating all that work over here might be a waste of time...

Finally, the failing ty qc check on the typing seems unrelated:

error[unresolved-attribute]: Attribute `keys` is not defined on `bool` in union `dict[Any, Any] | bool`
   --> bioconda_utils/circleci.py:262:48
    |
262 |             f"success={x['success']} {':'.join(x['urls'].keys())}" for x in self.parsed
    |                                                ^^^^^^^^^^^^^^
    |

Found 1 diagnostic

And I don't understand why the urls entry in self.parsed should possibly be bool instead of a dict, and where this implicit typing would happen. The respective code filling that key should always return a dict, even if it is empty because there's no match (and never a bool):

            urls = {
                key: url for url, key in re.findall(r"<(http[^|>]+)\|([^>]+)>", text)
            }

@bioconda/core , anybody up for a review?

@dlaehnemann dlaehnemann changed the title fix: adjust linting to new outputs structure feat!: adjust linting to new outputs structure May 29, 2026
@johanneskoester

Copy link
Copy Markdown
Contributor

OK, I think this is good to be reviewed and possibly merged.

This is another step towards proper linting of recipes with multiple outputs, also working towards supporting the new recipe.yaml format in that regard: https://rattler-build.prefix.dev/v0.65.0/reference/multi_output/

However, I have restricted it to linting the stuff that the existing multi-output recipes in bioconda require. This means that the linting currently does not check all of the inheritance behavior of the v1 recipe format. For example, the build number is only checked (and possibly fixed) on the top-level of the recipe, not per-output, as all the existing recipes just have a single build number and especially updating the automatic fixing code for the build numbers would be more involved. Also, it might make sense to eventually adopt the lint (and build) infrastructure of conda-forge at some point, which is already implementing the new recipe format in a backwards compatible manner. So duplicating all that work over here might be a waste of time...

Finally, the failing ty qc check on the typing seems unrelated:

error[unresolved-attribute]: Attribute `keys` is not defined on `bool` in union `dict[Any, Any] | bool`
   --> bioconda_utils/circleci.py:262:48
    |
262 |             f"success={x['success']} {':'.join(x['urls'].keys())}" for x in self.parsed
    |                                                ^^^^^^^^^^^^^^
    |

Found 1 diagnostic

And I don't understand why the urls entry in self.parsed should possibly be bool instead of a dict, and where this implicit typing would happen. The respective code filling that key should always return a dict, even if it is empty because there's no match (and never a bool):

            urls = {
                key: url for url, key in re.findall(r"<(http[^|>]+)\|([^>]+)>", text)
            }

@bioconda/core , anybody up for a review?

ty is not smart enough here, but the code is also quite old-fashioned I would say. Here is a PR that fixes this issue by using a dataclass instead: #1114

Comment thread bioconda_utils/lint/check_repo.py Outdated
@dlaehnemann dlaehnemann merged commit 4bfa874 into bioconda:master Jun 17, 2026
15 of 17 checks passed
@dlaehnemann dlaehnemann deleted the fix/adjust-linting-to-new-outputs-structure branch June 17, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants